﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.Flexibles.CApCableAttachmentFrameController
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.Flexibles;

public class CApCableAttachmentFrameController
{
  private CApCableAttachmentStatusAnalysis AttachmentStatusAnalysis { get; set; }

  public CApCableAttachmentFrameController(
    CApCableAttachmentStatusAnalysis attachmentStatusAnalysis)
  {
    this.AttachmentStatusAnalysis = attachmentStatusAnalysis;
  }

  public void AttachmentParentFrameDidChanged(ITxLocatableObject obj)
  {
    this.AttachmentStatusAnalysis.CableFrameAttachmentRetriever.UpdateFrameAttachmentRegistry(obj);
  }

  public void FrameEditorPicked(
    TxFrame selectedFrame,
    ref ITxLocatableObject attributeViewModelFrame,
    string controlText)
  {
    this.AttachmentParentFrameDidChanged(attributeViewModelFrame);
    if (TxFrame.op_Inequality(selectedFrame, (ITxObject) null))
    {
      if (controlText != "")
        CApCableUtility.UnHighlightObject((ITxDisplayableObject) (attributeViewModelFrame as TxFrame));
      attributeViewModelFrame = (ITxLocatableObject) selectedFrame;
      CApCableUtility.HighlightObject((ITxDisplayableObject) selectedFrame);
    }
    else
    {
      if (attributeViewModelFrame != null)
        CApCableUtility.UnHighlightObject((ITxDisplayableObject) (attributeViewModelFrame as TxFrame));
      attributeViewModelFrame = (ITxLocatableObject) null;
    }
  }
}
